package com.jwds.digital.bios.business.core.infrastructure.mapper.belt;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jwds.digital.bios.business.core.infrastructure.dto.belt.BeltRoutePerformanceHourReqDTO;
import com.jwds.digital.bios.business.core.infrastructure.entity.belt.BeltRoutePerformanceHour;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.AverageMotorOperatingEfficiencyStats;
import com.jwds.digital.bios.business.core.infrastructure.vo.belt.BeltRoutePerformanceHourRespVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 线路效能小时表 Mapper 接口
 *
 * @author 林柏云
 * @date 2024-10-24
 */
@Mapper
public interface BeltRoutePerformanceHourMapper extends BaseMapper<BeltRoutePerformanceHour> {

  /**
   * 分页查询
   * @param page 分页参数
   * @param condition 查询条件
   * @return respVOList 查询结果
   */
  IPage<BeltRoutePerformanceHourRespVO> pageQuery(@Param("page") Page<?> page, @Param("condition") BeltRoutePerformanceHourReqDTO condition);

  /**
  * 列表查询
  * @param condition 查询条件
  * @return respVOList 查询结果
  */
  List<BeltRoutePerformanceHourRespVO> queryList(@Param("condition") BeltRoutePerformanceHourReqDTO condition);

  /**
  * 根据ID查询
  * @param id 查询条件
  * @return respVO 查询结果
  */
  BeltRoutePerformanceHourRespVO queryById(@Param("id") Long id);

  /*******************扩展查询*******************/

  /**
   * 线路效能小时信息
   * @param routeId 线路id
   *
   * @return respVo 查询结果
   */
  //BeltRoutePerformanceHourRespVO getLineEfficiencyHour(@Param("routeId") Long routeId, @Param("i") int i);
  BeltRoutePerformanceHourRespVO getLineEfficiencyHour(@Param("routeId") Long routeId);

  /**
   * 每天开始时间内的线路效能信息
   * @param routeId 线路id
   * @return respVo 查询结果
   * @param startTime 每天开始时间
   * @param endTime 每天结束时间
   */
  List<BeltRoutePerformanceHourRespVO> getLineEfficiencyHourS(@Param("routeId") Long routeId, @Param("startTime") DateTime startTime, @Param("endTime") DateTime endTime);

  /**
   * 根据id查询线路总
   * @param id
   * @return
   */
  BeltRoutePerformanceHourRespVO searchById(Long id);

  /**
   *
   * @param routeId
   */
  List<AverageMotorOperatingEfficiencyStats> getAverageMotorOperatingEfficiencyStats(Long routeId);

    BeltRoutePerformanceHourRespVO searchByRouteId(Long id);
}
